using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class UnionPayTradeLogMap : EntityTypeConfiguration<UnionPayTradeLog>
	{
		public UnionPayTradeLogMap()
		{
			// Primary Key
			this.HasKey(t => t.UnionPayTradeLogID);

			// Properties
			this.Property(t => t.TradeType)
				.HasMaxLength(20);
				
			this.Property(t => t.EnterpriseID)
				.HasMaxLength(50);
				
			this.Property(t => t.PosCode)
				.HasMaxLength(20);
				
			this.Property(t => t.TradeDate)
				.HasMaxLength(6);
				
			this.Property(t => t.TradeTime)
				.HasMaxLength(8);
				
			this.Property(t => t.TradeSwiftNumber)
				.HasMaxLength(50);
				
			this.Property(t => t.ResultCode)
				.HasMaxLength(80);
				
			this.Property(t => t.Scomment)
				.HasMaxLength(300);
				
			this.Property(t => t.ProjectType)
				.HasMaxLength(20);
				
			this.Property(t => t.CustmerName)
				.HasMaxLength(50);
				
			this.Property(t => t.BackCode)
				.HasMaxLength(20);
				
			this.Property(t => t.CardNO)
				.HasMaxLength(20);
				
			this.Property(t => t.CertificateCode)
				.HasMaxLength(20);
				
			this.Property(t => t.SearchCode)
				.HasMaxLength(20);
				
			this.Property(t => t.AccountDate)
				.HasMaxLength(8);
				
			this.Property(t => t.CreatBy)
				.HasMaxLength(20);
				
			this.Property(t => t.Updateby)
				.HasMaxLength(20);
				
			this.Property(t => t.SourceTradeDate)
				.HasMaxLength(8);
				
			this.Property(t => t.SourceCertificateCode)
				.HasMaxLength(20);
				
			this.Property(t => t.FormerlyTradeDate)
				.HasMaxLength(6);
				
			this.Property(t => t.FormerlySearchCode)
				.HasMaxLength(12);
				
			// Table & Column Mappings
			this.ToTable("UnionPayTradeLog");
			this.Property(t => t.UnionPayTradeLogID).HasColumnName("UnionPayTradeLogID");
			this.Property(t => t.TradeType).HasColumnName("TradeType");
			this.Property(t => t.EnterpriseID).HasColumnName("EnterpriseID");
			this.Property(t => t.PosCode).HasColumnName("PosCode");
			this.Property(t => t.TradeDate).HasColumnName("TradeDate");
			this.Property(t => t.TradeTime).HasColumnName("TradeTime");
			this.Property(t => t.TradeSwiftNumber).HasColumnName("TradeSwiftNumber");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.ResultCode).HasColumnName("ResultCode");
			this.Property(t => t.Scomment).HasColumnName("Scomment");
			this.Property(t => t.ProjectType).HasColumnName("ProjectType");
			this.Property(t => t.CustmerName).HasColumnName("CustmerName");
			this.Property(t => t.NeedAmount).HasColumnName("NeedAmount");
			this.Property(t => t.BackCode).HasColumnName("BackCode");
			this.Property(t => t.CardNO).HasColumnName("CardNO");
			this.Property(t => t.CertificateCode).HasColumnName("CertificateCode");
			this.Property(t => t.SearchCode).HasColumnName("SearchCode");
			this.Property(t => t.AccountDate).HasColumnName("AccountDate");
			this.Property(t => t.SourceUnionPayTradeLogID).HasColumnName("SourceUnionPayTradeLogID");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.Updateby).HasColumnName("Updateby");
			this.Property(t => t.DoType).HasColumnName("DoType");
			this.Property(t => t.SourceTradeDate).HasColumnName("SourceTradeDate");
			this.Property(t => t.SourceCertificateCode).HasColumnName("SourceCertificateCode");
			this.Property(t => t.TradeAmount).HasColumnName("TradeAmount");
			this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
			this.Property(t => t.FormerlyTradeDate).HasColumnName("FormerlyTradeDate");
			this.Property(t => t.FormerlySearchCode).HasColumnName("FormerlySearchCode");
		}
	}
}

